from keras.utils import np_utils

print("X_train.shape: " + str(X_train.shape))
print("X_test.shape: " + str(X_test.shape))
print("y_train.shape: " + str(y_train.shape))
print("y_test.shape: " + str(y_test.shape))

print("y_train sample 5 value: " + str(y_train[5]))
print("y_train sample 2 value: " + str(y_train[2]))

# Conv2D expects 4 dimmensions; the last one is the number of channels
X_train = X_train.reshape(num_train_images,image_height,
                          image_width,NUM_CHANNELS)
X_test = X_test.reshape(num_test_images,image_height,
                        image_width,NUM_CHANNELS)

X_train = X_train / 255   # values [0..1] improve results
X_test = X_test / 255
    
y_train = np_utils.to_categorical(y_train)
y_test = np_utils.to_categorical(y_test)
print("categorical y_train shape: " + str(y_train.shape))
print("categorical y_train sample 5 value: " + str(y_train[5]))
print("categorical y_train sample 2 value: " + str(y_train[2])) 
num_classes = y_test.shape[1]
